#ifndef bailian_SwfManager_h
#define bailian_SwfManager_h

#include "../PreInclude.h"
#include "SwfDataVo.h"
#include "../DevMacros.h"
#include "../tui/TUI.h"

class CBaseMc{
    
public:
    CBaseMc();
	virtual ~CBaseMc() {}
    virtual bool updateMovieclip();
    DEV_PROPERTY(int, m_nTotalFrame, TotalFrame);
    
    virtual void end();
    virtual void start();
    int m_nMyFrame;
    
};



class TMovieItem:public TPanel,public CBaseMc{
public:
    
    TMovieItem();
    virtual ~TMovieItem();
    CREATE_FUNC(TMovieItem);
    
    virtual bool init();
    virtual void onEnter();
    virtual void onExit();
    
    virtual  void initWidthConf(xml_node<> * pItem);
    virtual bool updateMovieclip();
    virtual void setVisible(bool value);
    bool isPlay;
    bool isLoop;
    virtual void end();
    virtual void start();
    void pause(int frame=0);
    void continuePlay();
    void setPath(const string& path); 
    void clearCahe();
    DEV_PROPERTY_READONLY(CSwfBitContainer* , m_pContainer, Container);
protected:
    bool isPause;
    virtual void setBitVo(CSwfBitVo*);
    virtual void setContainerBitVo(CSwfBitContainer*, CSwfBitVo*);
    CSwfDataVo*  m_pMainSwf; 
};


class  SwfPro{

public :
    SwfPro();
    static SwfPro* shareSwfPro();
    virtual~SwfPro(); 
    void regSwf(CBaseMc* item); 
    void unRegSwf(CBaseMc* item);
    void updateMovieclip();
    
protected:
     map<CBaseMc*,int> m_gDic;
};


#endif
